CREATE TABLE [dbo].[LoanExecution](
	[LoanExecutionID] [uniqueidentifier] NOT NULL,
	[LoanID] [uniqueidentifier] NOT NULL,
	[GuarantorName] [nvarchar](50) NOT NULL,
	[GuarantorAddress] [nvarchar](50) NULL,
	[GuarantorSSN] [nvarchar](50) NOT NULL,
	[InterestPercentage] [decimal](5, 2) NOT NULL,
	[LoanPaymentMethodID] [uniqueidentifier] NOT NULL,
	[LoanAmount] [float] NOT NULL,
	[LoanPeriod] [int] NOT NULL,
	[TotalLoanAmount] [float] NOT NULL,
	[ExecutionDate] [datetime] NOT NULL,
	[CheckNumber] [nvarchar](50) NULL,
	[CheckDate] [datetime] NULL,
	[LoanExecutionStatus] [bit] NOT NULL,
 CONSTRAINT [PK_LoanExecution] PRIMARY KEY CLUSTERED 
(
	[LoanExecutionID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'نسبة الفائدة فى القرض' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LoanExecution', @level2type=N'COLUMN',@level2name=N'InterestPercentage'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'اجمالى قيمة القرض بعد اضافة الفائدة' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LoanExecution', @level2type=N'COLUMN',@level2name=N'TotalLoanAmount'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 if closed and 1 if opened, ده علشان لو عملنا اعادة جدولة القرض' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LoanExecution', @level2type=N'COLUMN',@level2name=N'LoanExecutionStatus'

